package com.cloudbroker.openapi.mobile.controller;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMapForBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import com.cloudbroker.bcs.platform.dav.bizapi.service.business.customer.back.*;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.customer.vo.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cloudbroker.bcs.common.entity.HSBCPSBackNumVO;
import com.cloudbroker.bcs.common.entity.HSBCPSBackVO;
import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.base.vo.HSBCPSVO;
import com.cloudbroker.bcs.platform.dav.bizapi.service.base.vo.ListQueryVO;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.system.back.BrokerAuthInfoForm;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.business.FansT2BizService;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.business.SystemT2BizService;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.business.UserManagerT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;

@Controller
public class UserController {
    
    @Resource
    private FansT2BizService fansT2;
    
    @Resource
    private UserManagerT2BizService userT2;
    
    @Resource
    private SystemT2BizService systemT2;
    
    /**
     * 发送验证短信
     */
    @ResponseBody
    @RequestMapping("/func_account_sendsms")
    @SaveLog(remark = "发送验证短信")
    public HSBCPSBackVO funcAccountSendSMS(HttpServletRequest request, String jsonpcallback) {
        SendSMSForm form = getSingleParameterMapForBody(request, SendSMSForm.class);
        return VOUtil.setJsonpResult(userT2.funcAccountSendsms(form), jsonpcallback);
    }
    
    /**
     * 获取用户ID
     * */
    @ResponseBody
    @RequestMapping("/func_userid_get")
    @SaveLog(remark = "获取用户ID")
    public UserIdGetBackForm funcUseridGet(HttpServletRequest request, String jsonpcallback) {
        UserIdGetForm form = getSingleParameterMapForBody(request, UserIdGetForm.class);
        return VOUtil.setJsonpResult(fansT2.funcUseridGet(form), jsonpcallback);
    }
    
    /**
     * 完善信息登录
     * */
    @ResponseBody
    @RequestMapping("/func_user_info_complet")
    @SaveLog(remark = "完善信息登录")
    public UserIdGetBackForm funcUserInfoComplet(HttpServletRequest request, String jsonpcallback) {
        UserInfoCompletForm form = getSingleParameterMapForBody(request, UserInfoCompletForm.class);
        return VOUtil.setJsonpResult(fansT2.funcUserInfoComplet(form), jsonpcallback);
    }
    
    /**
     * 粉丝手机号登录
     * */
    @ResponseBody
    @RequestMapping("/func_mobile_login")
    @SaveLog(remark = "粉丝手机号登录")
    public UserIdGetBackForm funcMobileLogin(HttpServletRequest request, String jsonpcallback) {
        MobileLoginForm form = getSingleParameterMapForBody(request, MobileLoginForm.class);
        return VOUtil.setJsonpResult(fansT2.funcMobileLogin(form), jsonpcallback);
    }
    
    /**
     * 粉丝密码登录
     * */
    @ResponseBody
    @RequestMapping("/func_password_login")
    @SaveLog(remark = "粉丝密码登录")
    public UserIdGetBackForm funcPasswordLogin(HttpServletRequest request, String jsonpcallback) {
        PasswordLoginForm form = getSingleParameterMapForBody(request, PasswordLoginForm.class);
        return VOUtil.setJsonpResult(fansT2.funcPasswordLogin(form), jsonpcallback);
    }
    
    /**
     * 粉丝重置密码
     */
    @ResponseBody
    @RequestMapping("/func_fans_reset_password")
    @SaveLog(remark = "粉丝重置密码")
    public HSBCPSBackVO funcFansResetPassword(HttpServletRequest request, String jsonpcallback) {
        ResetPasswordForm form = getSingleParameterMapForBody(request, ResetPasswordForm.class);
        return VOUtil.setJsonpResult(fansT2.funcFansResetPassword(form), jsonpcallback);
    }
    
    /**
     * 验证邀请码
     * */
    @ResponseBody
    @RequestMapping("/func_check_invitation_code")
    @SaveLog(remark = "验证邀请码")
    public HSBCPSBackVO funcCheckInvitationCode(HttpServletRequest request, String jsonpcallback) {
        InvitationCodeForm form = getSingleParameterMapForBody(request, InvitationCodeForm.class);
        return VOUtil.setJsonpResult(fansT2.funcCheckInvitationCode(form), jsonpcallback);
    }
    
    /**
     * 粉丝登出
     * */
    @ResponseBody
    @RequestMapping("/func_customer_logout")
    @SaveLog(remark = "粉丝登出")
    public HSBCPSBackVO funcCustomerLogout(HttpServletRequest request, String jsonpcallback) {
        HSBCPSVO form = getSingleParameterMapForBody(request, HSBCPSVO.class);
        return VOUtil.setJsonpResult(fansT2.funcCustomerLogout(form), jsonpcallback);
    }
    
    /**
     * 查询粉丝信息
     * */
    @ResponseBody
    @RequestMapping("/func_user_info_qry")
    @SaveLog(remark = "查询粉丝信息")
    public UserInfoBackForm funcUserInfoQry(HttpServletRequest request, String jsonpcallback) {
        HSBCPSVO form = getSingleParameterMapForBody(request, HSBCPSVO.class);
        return VOUtil.setJsonpResult(fansT2.funcUserInfoQry(form), jsonpcallback);
    }
    
    /**
     * 查询粉丝金币数
     * */
    @ResponseBody
    @RequestMapping("/func_user_amount_qry")
    @SaveLog(remark = "查询粉丝金币数")
    public HSBCPSBackNumVO funcUserAmountQry(HttpServletRequest request, String jsonpcallback) {
        HSBCPSVO form = getSingleParameterMapForBody(request, HSBCPSVO.class);
        return VOUtil.setJsonpResult(fansT2.funcUserAmountQry(form), jsonpcallback);
    }
    
    /**
     * 查询粉丝未读消息数
     * */
    @ResponseBody
    @RequestMapping("/func_noread_notice_qry")
    @SaveLog(remark = "查询粉丝未读消息数")
    public HSBCPSBackNumVO funcNoreadNoticeQry(HttpServletRequest request, String jsonpcallback) {
        HSBCPSVO form = getSingleParameterMapForBody(request, HSBCPSVO.class);
        return VOUtil.setJsonpResult(fansT2.funcNoreadNoticeQry(form), jsonpcallback);
    }
    
    /**
     * 查询粉丝提问数
     * */
    @ResponseBody
    @RequestMapping("/func_question_num_qry")
    @SaveLog(remark = "查询粉丝提问数")
    public HSBCPSBackNumVO funcQuestionNumQry(HttpServletRequest request, String jsonpcallback) {
        HSBCPSVO form = getSingleParameterMapForBody(request, HSBCPSVO.class);
        return VOUtil.setJsonpResult(fansT2.funcQuestionNumQry(form), jsonpcallback);
    }
    
    /**
     * 粉丝头像修改
     * */
    @ResponseBody
    @RequestMapping("/func_update_user_avatar")
    @SaveLog(remark = "粉丝头像修改")
    public HSBCPSBackVO funcUpdateUserAvatar(HttpServletRequest request, String jsonpcallback) {
        UpdateUserAvatarForm form = getSingleParameterMapForBody(request, UpdateUserAvatarForm.class);
        return VOUtil.setJsonpResult(fansT2.funcUpdateUserAvatar(form), jsonpcallback);
    }
    
    /**
     * 粉丝昵称修改
     * */
    @ResponseBody
    @RequestMapping("/func_update_user_name")
    @SaveLog(remark = "粉丝昵称修改")
    public HSBCPSBackVO funcUpdateUserName(HttpServletRequest request, String jsonpcallback) {
        UpdateUserNameForm form = getSingleParameterMapForBody(request, UpdateUserNameForm.class);
        return VOUtil.setJsonpResult(fansT2.funcUpdateUserName(form), jsonpcallback);
    }
    
    /**
     * 粉丝加金币专用
     * */
    @ResponseBody
    @RequestMapping("/func_fans_recharge")
    @SaveLog(remark = "粉丝加金币专用")
    public HSBCPSBackVO funcUserRecharge(HttpServletRequest request, String jsonpcallback) {
        HSBCPSVO form = getSingleParameterMapForBody(request, HSBCPSVO.class);
        return VOUtil.setJsonpResult(fansT2.funcFansRecharge(form), jsonpcallback);
    }
    
    /**
     * 东北证券国庆活动加金币
     * */
    @ResponseBody
    @RequestMapping("/func_fans_activity_recharge")
    @SaveLog(remark = "东北证券国庆活动加金币")
    public HSBCPSBackVO funcFansActivityRecharge(HttpServletRequest request, String jsonpcallback) {
        FansFundForm form = getSingleParameterMapForBody(request, FansFundForm.class);
        return VOUtil.setJsonpResult(fansT2.funcFansActivityRecharge(form), jsonpcallback);
    }
    
    /**
     * 粉丝积分新增
     * */
    @ResponseBody
    @RequestMapping("/func_fans_point_recharge")
    @SaveLog(remark = "粉丝积分新增")
    public HSBCPSBackVO funcFansPointRecharge(HttpServletRequest request, String jsonpcallback) {
        FansPointForm form = getSingleParameterMapForBody(request, FansPointForm.class);
        return VOUtil.setJsonpResult(fansT2.funcFansPointRecharge(form), jsonpcallback);
    }
    
    /**
     * 粉丝积分消费
     * */
    @ResponseBody
    @RequestMapping("/func_fans_point_consume")
    @SaveLog(remark = "粉丝积分消费")
    public HSBCPSBackVO funcFansPointConsume(HttpServletRequest request, String jsonpcallback) {
        FansPointForm form = getSingleParameterMapForBody(request, FansPointForm.class);
        return VOUtil.setJsonpResult(fansT2.funcFansPointConsume(form), jsonpcallback);
    }
    
    /**
     * 粉丝积分流水查询
     * */
    @ResponseBody
    @RequestMapping("/func_fans_point_query_list")
    @SaveLog(remark = "粉丝积分流水查询")
    public FansPointBackList funcFansPointQueryList(HttpServletRequest request, String jsonpcallback) {
        FansQueryForm form = getSingleParameterMapForBody(request, FansQueryForm.class);
        FansPointBackList fansPointBackList = fansT2.funcFansPointQueryList(form);
        return VOUtil.setJsonpResult(fansPointBackList, jsonpcallback);
    }
    
    /**
     * 粉丝积分查询
     * */
    @ResponseBody
    @RequestMapping("/func_fans_point_query")
    @SaveLog(remark = "粉丝积分查询")
    public FansPointBackForm funcFansPointQuery(HttpServletRequest request, String jsonpcallback) {
        FansBalanceForm form = getSingleParameterMapForBody(request, FansBalanceForm.class);
        return VOUtil.setJsonpResult(fansT2.funcFansPointQuery(form), jsonpcallback);
    }
    
    /**
     * 粉丝积分查询
     * */
    @ResponseBody
    @RequestMapping("/func_fans_point_query_login")
    @SaveLog(remark = "粉丝登录积分查询")
    public FansPointBackForm funcFansPointQueryLogin(HttpServletRequest request, String jsonpcallback) {
        HSBCPSVO form = getSingleParameterMapForBody(request, HSBCPSVO.class);
        return VOUtil.setJsonpResult(fansT2.funcFansPointQueryLogin(form), jsonpcallback);
    }
    
    /**
     * 粉丝积分入口URL地址
     * */
    @ResponseBody
    @RequestMapping("/func_fans_point_url")
    @SaveLog(remark = "粉丝积分入口URL地址")
    public FansPointUrlBackForm funcFansPointUrl(HttpServletRequest request, String jsonpcallback) {
        HSBCPSVO form = getSingleParameterMapForBody(request, HSBCPSVO.class);
        return VOUtil.setJsonpResult(fansT2.funcFansPointUrl(form), jsonpcallback);
    }
    
    /**
     * 粉丝充值明细
     * */
    /*
    @ResponseBody
    @RequestMapping("/func_recharge_detail_qry")
    @SaveLog(remark = "粉丝充值明细")
    public RechargeDetailBackList funcRechargeDetailQry(HttpServletRequest request , String jsonpcallback){
    RechargeDetailQryForm form = getSingleParameterMapForBody(request , RechargeDetailQryForm.class);
    return VOUtil.setJsonpResult(fansT2.funcRechargeDetailQry(form), jsonpcallback);
    }*/
    
    /**
     * 粉丝消费明细
     * */
    @ResponseBody
    @RequestMapping("/func_detail_qry")
    @SaveLog(remark = "粉丝明细")
    public ConsumeDetailBackList funcConsumeDetailQry(HttpServletRequest request, String jsonpcallback) {
        ConsumeDetailQryForm form = getSingleParameterMapForBody(request, ConsumeDetailQryForm.class);
        return VOUtil.setJsonpResult(fansT2.funcConsumeDetailQry(form), jsonpcallback);
    }
    
    /**
     * 用户提建议
     * */
    @ResponseBody
    @RequestMapping("/func_suggestion_add")
    @SaveLog(remark = "用户提建议")
    public HSBCPSBackVO funcSuggestionAdd(HttpServletRequest request, String jsonpcallback) {
        SuggestionAddForm form = getSingleParameterMapForBody(request, SuggestionAddForm.class);
        return VOUtil.setJsonpResult(fansT2.funcSuggestionAdd(form), jsonpcallback);
    }
    
    /**
     * 粉丝获取通知消息
     * */
    @ResponseBody
    @RequestMapping("/func_roll_notice_list")
    @SaveLog(remark = "粉丝获取通知消息")
    public NoticeQryBackList funcNoticeListQry(HttpServletRequest request, String jsonpcallback) {
        NoticeForm form = getSingleParameterMapForBody(request, NoticeForm.class);
        return VOUtil.setJsonpResult(fansT2.funcNoticeListQry(form), jsonpcallback);
    }
    
    /**
     * 获取大V授权账户
     */
    @ResponseBody
    @RequestMapping("/func_broker_auth_info_get")
    @SaveLog(remark = "获取大V授权账户")
    public BrokerAuthInfoForm funcAuthBroker(HttpServletRequest request, String jsonpcallback) {
        HSBCPSVO form = getSingleParameterMapForBody(request, HSBCPSVO.class);
        return VOUtil.setJsonpResult(systemT2.funcAuthBroker(form), jsonpcallback);
    }
    
    /**
     * fans获取在线用户数
     */
    @ResponseBody
    @RequestMapping("/func_chatroom_onlinenum_by_fans")
    @SaveLog(remark = "fans获取在线用户数")
    public OnlineNumResultByFans funcChatRoomOnlineNumByFans(HttpServletRequest request, String jsonpcallback) {
        HSBCPSVO form = getSingleParameterMapForBody(request, HSBCPSVO.class);
        return VOUtil.setJsonpResult(fansT2.funcChatRoomOnlineNumByFans(form), jsonpcallback);
    }
    
    /**
     * 多投顾获取用户ID
     * */
    @ResponseBody
    @RequestMapping("/func_userid_get_by_tenant")
    @SaveLog(remark = "多投顾获取用户ID")
    public UserIdGetBackForm funcUseridGetByTenant(HttpServletRequest request, String jsonpcallback) {
        UserIdGetByTenantForm form = getSingleParameterMapForBody(request, UserIdGetByTenantForm.class);
        return VOUtil.setJsonpResult(fansT2.funcUseridGetByTenant(form), jsonpcallback);
    }
    
    /**
     * 多投顾完善信息登录
     * */
    @ResponseBody
    @RequestMapping("/func_user_info_complet_by_tenant")
    @SaveLog(remark = "多投顾完善信息登录")
    public UserIdGetBackForm funcUserInfoCompletByTenant(HttpServletRequest request, String jsonpcallback) {
        UserInfoCompletByTenantForm form = getSingleParameterMapForBody(request, UserInfoCompletByTenantForm.class);
        return VOUtil.setJsonpResult(fansT2.funcUserInfoCompletByTenant(form), jsonpcallback);
    }
    
    /**
     * 多投顾粉丝手机号登录
     * */
    @ResponseBody
    @RequestMapping("/func_mobile_login_by_tenant")
    @SaveLog(remark = "多投顾粉丝手机号登录")
    public UserIdGetBackForm funcMobileLoginByTenant(HttpServletRequest request, String jsonpcallback) {
        MobileLoginByTenantForm form = getSingleParameterMapForBody(request, MobileLoginByTenantForm.class);
        return VOUtil.setJsonpResult(fansT2.funcMobileLoginByTenant(form), jsonpcallback);
    }
    
    /**
     * 多投顾粉丝密码登录
     * */
    @ResponseBody
    @RequestMapping("/func_password_login_by_tenant")
    @SaveLog(remark = "多投顾粉丝密码登录")
    public UserIdGetBackForm funcPasswordLoginByTenant(HttpServletRequest request, String jsonpcallback) {
        PasswordLoginByTenantForm form = getSingleParameterMapForBody(request, PasswordLoginByTenantForm.class);
        return VOUtil.setJsonpResult(fansT2.funcPasswordLoginByTenant(form), jsonpcallback);
    }
    
    /**
     * 多投顾粉丝手机号登录
     * */
    @ResponseBody
    @RequestMapping("/func_is_capital_account")
    @SaveLog(remark = "是否是资金账号")
    public CustomerAccountTypeBack funcIsCapitalAccount(HttpServletRequest request, String jsonpcallback) {
        HSBCPSVO form = getSingleParameterMapForBody(request, HSBCPSVO.class);
        return VOUtil.setJsonpResult(fansT2.funcIsCapitalAccount(form), jsonpcallback);
    }
    
    /**
     * 粉丝关注大V
     * */
    @ResponseBody
    @RequestMapping("/func_fans_follow_broker")
    @SaveLog(remark = "粉丝关注大V")
    public HSBCPSBackVO funcFansFollowBroker(HttpServletRequest request, String jsonpcallback) {
        FollowBrokerForm form = getSingleParameterMapForBody(request, FollowBrokerForm.class);
        return VOUtil.setJsonpResult(fansT2.funcFansFollowBroker(form), jsonpcallback);
    }
    
    /**
     * 粉丝取消关注大V
     * */
    @ResponseBody
    @RequestMapping("/func_fans_cancel_follow_broker")
    @SaveLog(remark = "粉丝取消关注大V")
    public HSBCPSBackVO funcFansCancelFollowBroker(HttpServletRequest request, String jsonpcallback) {
        FollowBrokerForm form = getSingleParameterMapForBody(request, FollowBrokerForm.class);
        return VOUtil.setJsonpResult(fansT2.funcFansCancelFollowBroker(form), jsonpcallback);
    }
    
    /**
     * 粉丝进入大V页面
     * */
    @ResponseBody
    @RequestMapping("/func_fans_click_broker")
    @SaveLog(remark = "粉丝进入大V页面")
    public FollowBrokerResult funcFansClickBroker(HttpServletRequest request, String jsonpcallback) {
        FollowBrokerForm form = getSingleParameterMapForBody(request, FollowBrokerForm.class);
        return VOUtil.setJsonpResult(fansT2.funcFansClickBroker(form), jsonpcallback);
    }
    
    /**
     * 多投顾列表
     * */
    @ResponseBody
    @RequestMapping("/func_broker_list_by_tenant")
    @SaveLog(remark = "多投顾列表")
    public BrokerListResult funcBrokerListByTenant(HttpServletRequest request, String jsonpcallback) {
        BrokerListTenant form = getSingleParameterMapForBody(request, BrokerListTenant.class);
        return VOUtil.setJsonpResult(fansT2.funcBrokerListByTenant(form), jsonpcallback);
    }
    
    /**
     * 多投顾下拉列表
     */
    @ResponseBody
    @RequestMapping("/func_broker_dropdown_list_by_tenant")
    @SaveLog(remark = "投顾下拉列表")
    public BrokerDropdownList funcBrokerDropdownListByTenant(HttpServletRequest request, String jsonpcallback) {
        ListQueryVO form = getSingleParameterMapForBody(request, ListQueryVO.class);
        return VOUtil.setJsonpResult(fansT2.funcBrokerDropdownListByTenant(form), jsonpcallback);
    }
    
    /**
     * 获取light的access_token
     * */
    @ResponseBody
    @RequestMapping("/func_get_light_access_token")
    @SaveLog(remark = "获取light的Access_token")
    public AccessTokenForm funcGetLightAccessToken(HttpServletRequest request, String jsonpcallback) {
        OpenIDForm form = getSingleParameterMapForBody(request, OpenIDForm.class);
        return VOUtil.setJsonpResult(fansT2.funcGetLightAccessToken(form), jsonpcallback);
    }
    
    /**
     * 获取访客token
     * @param request
     * @param jsonpcallback
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_guest_token")
    @SaveLog(remark = "获取访客token")
    public GuestResultData funcGuestToken(HttpServletRequest request, String jsonpcallback) {
        GuestTokenForm form = getSingleParameterMapForBody(request, GuestTokenForm.class);
        return VOUtil.setJsonpResult(fansT2.funcGuestToken(form), jsonpcallback);
    }
    
    /**
     * 三方用户注册
     * @param request
     * @param jsonpcallback
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_fans_app_reg_login")
    @SaveLog(remark = "三方用户注册")
    public FansAppRegLoginBackData funcFansAppRegLogin(HttpServletRequest request, String jsonpcallback) {
        FansAppRegLoginForm form = getSingleParameterMapForBody(request, FansAppRegLoginForm.class);
        return VOUtil.setJsonpResult(fansT2.funcFansAppRegLogin(form), jsonpcallback);
    }
    
    /**
     * 操作行为记录
     * @param request
     * @param jsonpcallback
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_action_log")
    @SaveLog(remark = "操作行为记录")
    public HSBCPSBackVO funcActionLog(HttpServletRequest request, String jsonpcallback) {
        ActionLogForm form = getSingleParameterMapForBody(request, ActionLogForm.class);
        return VOUtil.setJsonpResult(fansT2.funcActionLog(form), jsonpcallback);
    }
    
    /**
     * 根据userid获取投顾信息
     * @param request
     * @param jsonpcallback
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_get_brokerinfo_by_userid")
    @SaveLog(remark = "根据userid获取投顾信息")
    public BrokerInfoByUserIdBack funcGetBrokerInfoByUserId(HttpServletRequest request, String jsonpcallback) {
        BrokerInfoByUserIdForm form = getSingleParameterMapForBody(request, BrokerInfoByUserIdForm.class);
        return VOUtil.setJsonpResult(fansT2.funcGetBrokerInfoByUserId(form), jsonpcallback);
    }
    
    /**
     * 查询调研列表支付状态
     * */
    @ResponseBody
    @RequestMapping("/func_survey_status_list")
    @SaveLog(remark = "调研Codes支付状态查询")
    public SurveyStatusList funcSurveyStatusList(HttpServletRequest request, String jsonpcallback) {
        SurveyStatusListForm form = getSingleParameterMapForBody(request, SurveyStatusListForm.class);
        return VOUtil.setJsonpResult(fansT2.funcSurveyStatusList(form), jsonpcallback);
    }
}
